package com.kin207.netty.el;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ELParse {
	final static  Pattern VALUE_PATTERN = Pattern.compile("(?<=^\\$\\{).*(?=\\}$)");
	
	public static Object parseValue(String elStr, ELCallback callback){
		 Matcher matcher = VALUE_PATTERN.matcher(elStr);
		 if(matcher.find()){
			 String value = matcher.group();
			 return callback.callback(value);
		 }
		 return elStr;
	}
}
